<template>
  <div id="app">
    <!-- <div class="item" v-for="item of movies" :key="item.id">
    <p>{{item.title}}</p>
    <img :src="item.images.small" alt />//vue中一个属性要使用变量的话 前面要加上冒号
    </div>-->
    <MovieItem :data="item" v-for="item of movies" :key="item.id"></MovieItem>
  </div>
</template>

<script>
import axios from "axios-jsonp-pro";
import MovieItem from "./components/Item";
export default {
  name: "app",
  data() {
    return {
      movies: []
    };
  },
  components: {
    MovieItem
  },
  methods: {},
  mounted() {
    var url = "https://douban.uieee.com/v2/movie/top250";
    axios.jsonp(url).then(res => {
      console.log(res);
      this.movies = res.subjects;
    });
  }
};
</script>

<style lang="stylus" scoped>

</style>